<!DOCTYPE html>
<html lang="utf-8">

<head>
	<title>内网穿透 Tunnel</title>
	<!-- Meta tag Keywords -->
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<meta charset="UTF-8" />
	<meta name="keywords" content="内网穿透|内网支付|内网回调|http请求内网" />
	<meta name="description" content="内网穿透|外网请求穿透至内网服务接口">
	
	<script>
		addEventListener("load", function () {
			setTimeout(hideURLbar, 0);
		}, false);

		function hideURLbar() {
			window.scrollTo(0, 1);
		}
	</script>
	<!-- //Meta tag Keywords -->

	<!-- Custom-Files -->
	<link rel="stylesheet" href="css/bootstrap.css">
	<!-- Bootstrap-Core-CSS -->
	<link rel="stylesheet" href="css/style.css" type="text/css" media="all" />
	<!-- Style-CSS -->
	<link href="css/font-awesome.min.css" rel="stylesheet">
	<!-- Font-Awesome-Icons-CSS -->
	<!-- //Custom-Files -->

	<!-- Web-Fonts -->
	<link href="https://fonts.googleapis.com/css?family=Poppins:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i&amp;subset=devanagari,latin-ext"
	 rel="stylesheet">
	<!-- //Web-Fonts -->
</head>

<body>
	<!-- main banner -->
	<div class="main-top" id="home">
		<!-- header -->
		<header id="HEADER_MVVM">
			<div class="container-fluid">
				<div class="header d-lg-flex justify-content-between align-items-center py-3 px-sm-3">
					<!-- logo -->
					<div id="logo">
						<h1><a href="index.html">Tunnel</a></h1>
					</div>
					<!-- //logo -->
					<!-- nav -->
					<div class="nav_w3ls">
						<nav>
							<label for="drop" class="toggle"><span class="fa fa-bars" aria-hidden="true"></span></label>
							<input type="checkbox" id="drop" />
							<ul class="menu" nc-if="!user.name">
								<li><a href="javascript:void(0)" onclick="AUTH_MVVM.$scope.step=3;location.href='#auth';" class="active">登陆</a></li>
								<li><a href="javascript:void(0)" onclick="AUTH_MVVM.$scope.step=1;location.href='#auth';">注册</a></li>
							</ul>
							<ul class="menu" nc-if="user.name">
								<li><a href="javascript:void(0)" nc-text="{{user.name}}" onclick="showDomain()"></a></li>
								<li><a href="javascript:void(0)" nc-text="{{user.expire}}" onclick="showPrice()"></a></li>
								<li><a href="javascript:void(0)" onclick="logout()" class="active" >退出</a></li>
							</ul>
						</nav>
					</div>
				</div>
			</div>
		</header>
		<!-- //header -->
		<!-- banner -->
		<div class="banner_w3lspvt position-relative">
			<div class="container">
				<div class="d-md-flex">
					<div class="w3ls_banner_txt">
						<h3 class="w3ls_pvt-title">外网-> <br><span>>-内网</span></h3>
						<p class="text-sty-banner">Tunnel 可以让外网请求送达至你的内网，您可以使用Tunnel，
						在内网环境完成支付回调等 第三方http回调通知 的对接和测试!</p>
						<a href="#desc" class="btn button-style mt-md-5 mt-4">立即 使用</a>
					</div>
					<div class="banner-img">
						<img src="images/banner.png" alt="Tunnel 外网请求送达至你的内网" class="img-fluid">
					</div>
				</div>
			</div>
			<!-- animations effects -->
			<div class="icon-effects-w3l">
				<img src="images/shape1.png" alt="Tunnel 内网穿透 内网回调" class="img-fluid shape-wthree shape-w3-one">
				<img src="images/shape2.png" alt="Tunnel 内网穿透 内网回调" class="img-fluid shape-wthree shape-w3-two">
				<img src="images/shape3.png" alt="Tunnel 内网穿透 内网回调" class="img-fluid shape-wthree shape-w3-three">
				<img src="images/shape5.png" alt="Tunnel 内网穿透 内网回调" class="img-fluid shape-wthree shape-w3-four">
				<img src="images/shape4.png" alt="Tunnel 内网穿透 内网回调" class="img-fluid shape-wthree shape-w3-five">
				<img src="images/shape6.png" alt="Tunnel 内网穿透 内网回调" class="img-fluid shape-wthree shape-w3-six">
			</div>
			<!-- //animations effects -->
		</div>
		<!-- //banner -->
	</div>
	<!-- //main banner -->
	<!-- what we do section -->
	<div class="what bg-li py-5" id="what">
		<div class="container py-xl-5 py-lg-3">
			<div class="row about-bottom-w3l text-center mt-4">
				<div class="col-lg-4 about-grid">
					<div class="about-grid-main">
						<img src="images/img2.png" alt="" class="img-fluid">
						<h4 class="my-4">HTTPS免配置</h4>
						<p>所有域名支持Https请求，无需手动申请与配置证书，满足第三方支付接口回调要求。</p>
						<a title="Https请求 接口回调" href="#desc" class="button-w3ls btn mt-sm-5 mt-4">立即 使用</a>
					</div>
				</div>
				<div class="col-lg-4 about-grid my-lg-0 my-5">
					<div class="about-grid-main">
						<img src="images/img1.png" alt="" class="img-fluid">
						<h4 class="my-4">账号 多开</h4>
						<p>一个账号可以登陆多个客户端，多个局域网内（或开发者之间）可以同时使用。</p>
						<a title="局域网内 同时使用" href="#desc" class="button-w3ls btn mt-sm-5 mt-4">立即 使用</a>
					</div>
				</div>
				<div class="col-lg-4 about-grid">
					<div class="about-grid-main">
						<img src="images/img3.png" alt="" class="img-fluid">
						<h4 class="my-4">windows/linux</h4>
						<p>可以在windows环境下启动，也可以在linux服务器上启动，用于测试环境做外网的接口测试。</p>
						<a title="外网的接口测试" href="#desc" class="button-w3ls btn mt-sm-5 mt-4">立即 使用</a>
					</div>
				</div>
			</div>
		</div>
	</div>
	<!-- //what we do section -->
	<!-- middle -->
	<a name="desc"></a>
	<section class="midd-w3 py-5" id="faq">
		<div class="container py-xl-5 py-lg-3">
			<div class="row">
				<div class="col-lg-6 about-right-faq">
					<h6>linux环境下</h6>
					<h3 class="text-da">Tunnel 客户端的使用方法</h3>
					<p class="mt-4">windows环境下启动方式差不多，压缩包内提供了start.sh文件，双击start.sh即可运行，无论您是在windows或者linux下使用，请先安装java运行环境jdk（版本不小于jdk 8)。</p>
					<ul class="w3l-right-book mt-4">
						<li>下载 zip包，百度网盘提取码 ：rm9m</li>
						<li>解压缩 zip包：unzip -o -d tunnel tunnel.zip</li>
						<li>修改配置文件：vi sys.properties</li>
						<li>启动 Tunnel ：./start.sh</li>
					</ul>
					<a href="https://pan.baidu.com/s/1fKIcx7fPYyaa4bdRRmxDzQ" target="_blank" class="btn button-style button-style-2 mt-sm-5 mt-4">下载 tunnel.zip（9M）</a>
				</div>
				<div class="col-lg-6 left-wthree-img text-right">
					<img title="客户端连接" src="images/b1.png" alt="" class="img-fluid mt-1" />
				</div>
			</div>
		</div>
	</section>
	<!-- //middle -->
	
	<!-- 动态部分的锚点 -->
	<a name="auth"></a>
	<a name="domain"></a>
	<a name="price"></a>
	

	<!-- footer -->
	<footer class="bg-li" id="AUTH_MVVM" nc-if="show">
		<div class="container py-xl-5 py-lg-3">
			<!-- subscribe -->
			<div class="subscribe mx-auto">
				<h2 class="tittle text-center font-weight-bold" nc-if="step==1||step==2">第一步 注册账号!</h2>
				<h2 class="tittle text-center font-weight-bold" nc-if="step==3||step==4">欢迎登录使用！</h2>
				<p class="sub-tittle text-center mt-3 mb-sm-5 mb-4" nc-if="step==1">使用Tunnel需先注册账号，然后才是下载客户端并使用。我有账号，<a href="javascript:void(0)" onclick="AUTH_MVVM.$scope.step=3;">直接登录</a>。</p>
				<p class="sub-tittle text-center mt-3 mb-sm-5 mb-4" nc-if="step==2">输入一个密码（不少于6位），点击“注册”按钮，您将收到一封确认邮件，完成注册。</p>
				<p class="sub-tittle text-center mt-3 mb-sm-5 mb-4" nc-if="step==3">请输入您注册时使用的邮箱地址。还没有注册，<a href="javascript:void(0)" onclick="AUTH_MVVM.$scope.step=1;">点我注册</a>。</p>
				<p class="sub-tittle text-center mt-3 mb-sm-5 mb-4" nc-if="step==4">请输入您的密码，如果密码已忘记，<a href="javascript:void(0)" onclick="forgetPassword()">请点这里</a>。</p>
				<form class="subscribe-wthree pt-2">
					<div class="d-flex subscribe-wthree-field">
						<input nc-if="step==1||step==3" class="form-control" type="email" nc-value="user.email" placeholder="输入您的邮箱..." name="email" required="">
						<input nc-if="step==2" class="form-control" maxlength="32" type="password" nc-value="user.password" placeholder="请再输入一个不少于6位的密码..." required="">
						<input nc-if="step==4" class="form-control" maxlength="32" type="password" nc-value="user.password" placeholder="请输入您的密码..." required="">
						<button class="btn form-control w-50" type="button" onclick="registerAndLogin()" nc-if="step==1||step==3">下一步</button>
						<button class="btn form-control w-50" type="button" onclick="registerAndLogin()" nc-if="step==2">注册</button>
						<button class="btn form-control w-50" type="button" onclick="registerAndLogin()" nc-if="step==4">登录</button>
					</div>
				</form>
			</div>
			<!-- //subscribe -->
		</div>
	</footer>
	<!-- //footer -->
	
	<!-- domain -->
	<footer class="bg-li" id="DOMAIN_MVVM" nc-if="show">
		<div class="container py-xl-5 py-lg-3">
			<!-- subscribe -->
			<div class="subscribe mx-auto">
				<h2 class="tittle text-center font-weight-bold" >申请一个域名!</h2>
				<p class="sub-tittle text-center mt-3 mb-sm-5 mb-4" >除了www以外，您可以申请任何三级域名，也可以申请四、五级域名。</p>
				<form class="subscribe-wthree pt-2">
					<div class="d-flex subscribe-wthree-field">
						<input class="form-control" type="text" nc-value="domainName" placeholder="输入您的域名xxx，仅限英文字母、数字、点，长度控制在16位以内" name="" required="">
						<button class="btn form-control w-50" type="button" onclick="postDomain()" style="text-align: left;">.tunnel.cool&nbsp;&nbsp;申请</button>
					</div>
				</form>
			</div>
			<!-- //subscribe -->
		</div>
		
		<div class="container py-xl-5 py-3">
			<div class="row">
				<div nc-for="entity in domainList" class="col-md-4" style="margin-bottom: 15px;">
					<div class="ser-grd">
						<div class="row">
							<div class="col-md-2 col-2 text-center services-icon icon-clr5">
								<span class="fa fa-link" style="margin-top: 28px;"></span>
							</div>
							<div class="col-md-9 col-10 text-left services-grid">
								<h4 nc-text="{{entity.name}}.tunnel.cool"></h4>
								<p nc-text="{{entity.createTime|timeFormat}} 创建"></p>
								<p onclick="delDomain('{{entity.name}}')" style="cursor: pointer;color: #39dcb1;">删除域名配置</>
							</div>
						</div>
					</div>
				</div>
			</div>
			<p nc-if="userExpire" class="sub-tittle text-center mt-3 mb-sm-5 mb-4"><a href="javascript:void(0)" onclick="showPrice()">现在续费，低至2分钱/天，</a>非会员（或过期）每天可免费连接（10分钟）。</p>
		</div>
	</footer>
	<!-- //domain -->
	
	<!-- price -->
	<div id="PRICE_MVVM" class="price-sec" nc-if="show">
		<div class="container py-xl-5 py-lg-3">
			<!-- subscribe -->
			<div class="subscribe mx-auto">
				<h2 class="tittle text-center font-weight-bold" nc-text="{{title}}" >会员续费</h2>
			</div>
			<!-- //subscribe -->
		</div>
		<p nc-if="payCodeUrl" class="sub-tittle text-center mt-3 mb-sm-5 mb-4" nc-text="{{payLimit}}" style="margin-bottom: 0px !important;"></p>
		<div nc-if="!payCodeUrl" class="container py-xl-5 py-lg-3">
			<div class="inner_sec_info_w3_info mt-3">
				<div class="row price-grid-main">
					<div class="col-lg-3 col-sm-6 price-info">
						<div class="prices p-4">
							<div class="prices-top">
								<h3 class="text-center text-wh rounded-circle">￥0.1</h3>
							</div>
							<div class="prices-bottom text-center">
								<div class="prices-h border-bottom p-4">
									<h4>24小时</h4>
								</div>
								<ul class="mt-4">
									<li>适合临时测试使用</li>
									<li>费用极低，使用灵活</li>
									<li>便宜但功能完整</li>
								</ul>
								<a href="javascript:void(0)" onclick="createPay('Tunnel会员24小时')" class="btn button-style mt-4">购买</a>
							</div>
						</div>
					</div>
					<div class="col-lg-3 col-sm-6  price-info price-mkres-2">
						<div class="prices p-4 active">
							<div class="prices-top">
								<h3 class="text-center text-wh rounded-circle">￥1.5</h3>
							</div>
							<div class="prices-bottom text-center">
								<div class="prices-h border-bottom p-4">
									<h4>30天</h4>
								</div>
								<ul class="mt-4">
									<li>适合阶段项目使用</li>
									<li>一次性30天使用周期</li>
									<li>费用优惠，比较方便</li>
								</ul>
								<a href="javascript:void(0)" onclick="createPay('Tunnel会员30天')" class="btn button-style mt-4">购买</a>
							</div>
						</div>
					</div>
					<div class="col-lg-3 col-sm-6  price-info price-mkres">
						<div class="prices p-4">
							<div class="prices-top">
								<h3 class="text-center text-wh rounded-circle">￥4.5</h3>
							</div>
							<div class="prices-bottom text-center">
								<div class="prices-h border-bottom p-4">
									<h4>6个月</h4>
								</div>
								<ul class="mt-4">
									<li>适合阶段项目使用</li>
									<li>6个月180天长周期</li>
									<li>费用低至2分/天</li>
								</ul>
								<a href="javascript:void(0)" onclick="createPay('Tunnel会员6个月（180天）')" class="btn button-style mt-4">购买</a>
							</div>
						</div>
					</div>
					<div class="col-lg-3 col-sm-6  price-info price-mkres">
						<div class="prices p-4 active">
							<div class="prices-top">
								<h3 class="text-center text-wh rounded-circle">￥7.5</h3>
							</div>
							<div class="prices-bottom text-center">
								<div class="prices-h border-bottom p-4">
									<h4>1年</h4>
								</div>
								<ul class="mt-4">
									<li>适合阶段项目使用</li>
									<li>一年期365天超长周期</li>
									<li>费用低至2分/天</li>
								</ul>
								<a href="javascript:void(0)" onclick="createPay('Tunnel会员1年（365天）')" class="btn button-style mt-4">购买</a>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
		<p nc-if="userExpire && !payCodeUrl" class="sub-tittle text-center mt-3 mb-sm-5 mb-4"><a href="javascript:void(0)" onclick="showPrice()">现在续费，低至2分钱/天，</a>非会员（或过期）每天可免费连接（10分钟）。</p>
		<div nc-if="payCodeUrl" class="container py-xl-5 py-lg-3">
			<div class="inner_sec_info_w3_info mt-3">
				<div class="row price-grid-main">
					<img style="margin-left: 40%;" nc-src="{{payCodeUrl}}">
				</div>
			</div>
		</div>
		<p nc-if="payCodeUrl" class="sub-tittle text-center mt-3 mb-sm-5 mb-4">请扫描二维码完成支付。</p>
	</div>
	<!-- //price -->
	
	<!-- partners -->
	<section class="partners py-5" id="partners">
		<div class="container py-xl-5 py-lg-3">
			<h3 class="tittle text-center font-weight-bold">使用场景</h3>
			<p class="sub-tittle text-center mt-3 mb-sm-5 mb-4">请不要使用Tunnel服务做违法的事情，Tunnel仅提供开发者暴露Http服务接口用于开发测试使用，非常抱歉，Tunnel现在不会 将来也不会提供用于展示内网网页或提供给网络用户下载内网资源的能力。</p>
			<div class="row grid-part text-center pt-4">
				<div class="col-md-2 col-4">
					<div class="parts-w3ls">
						<span class="fa fa-jpy"></span>
						<h4>本地支付测试</h4>
					</div>
				</div>
				<div class="col-md-2 col-4">
					<div class="parts-w3ls">
						<span class="fa fa-android"></span>
						<h4>App外网测试</h4>
					</div>
				</div>
				<div class="col-md-2 col-4">
					<div class="parts-w3ls">
						<span class="fa fa-database"></span>
						<h4>线上备份数据</h4>
					</div>
				</div>
				<div class="col-md-2 col-4">
					<div class="parts-w3ls">
						<span class="fa fa-users"></span>
						<h4>跨网协同开发</h4>
					</div>
				</div>
				<div class="col-md-2 col-4">
					<div class="parts-w3ls">
						<span class="fa fa-power-off"></span>
						<h4>远程内网开关机</h4>
					</div>
				</div>
				<div class="col-md-2 col-4">
					<div class="parts-w3ls">
						<span class="fa fa-yelp"></span>
						<h4>其他你能发现的！</h4>
					</div>
				</div>
			</div>
		</div>
	</section>
	<!-- //partners -->

	<!-- copyright bottom -->
	<div class="copy-bottom bg-li py-4 border-top">
		<div class="container-fluid">
			<div class="d-md-flex px-md-3 position-relative text-center">
				<!-- //footer social icons -->
				<!-- copyright -->
				<div class="copy_right mx-md-auto mb-md-0 mb-3">
					<p>技术问题进QQ群咨询：599819056</p>
					<p class="text-bl let">Copyright &copy; 2020.Tunnel All rights reserved. &nbsp;苏ICP备2020069323号</p>
				</div>
			</div>
		</div>
	</div>
	<!-- //copyright bottom -->

</body>
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery.cookie-1.4.1.min.js"></script>
<script type="text/javascript" src="js/nice-mvvm.js"></script>
<script type="text/javascript" src="js/nice-ajax.js"></script>
<script type="text/javascript" src="js/md5.js"></script>
<script>
function timeFormat(timeStamp) {
	var date = new Date(timeStamp);
	fmt = "YYYY-mm-dd HH:MM";
    let ret;
    const opt = {
        "Y+": date.getFullYear().toString(),        // 年
        "m+": (date.getMonth() + 1).toString(),     // 月
        "d+": date.getDate().toString(),            // 日
        "H+": date.getHours().toString(),           // 时
        "M+": date.getMinutes().toString(),         // 分
        "S+": date.getSeconds().toString()          // 秒
        // 有其他格式化字符需求可以继续添加，必须转化成字符串
    };
    for (let k in opt) {
        ret = new RegExp("(" + k + ")").exec(fmt);
        if (ret) {
            fmt = fmt.replace(ret[1], (ret[1].length == 1) ? (opt[k]) : (opt[k].padStart(ret[1].length, "0")))
        };
    };
    return fmt;
}
</script>
<script type="text/javascript">
	//########## 头部用户信息###################
	var HEADER_MVVM = $NICE_MVVM("HEADER_MVVM");
	HEADER_MVVM.$scope.user={};
	HEADER_MVVM.$init();
	
	//########## 登录和注册 ####################
	var AUTH_MVVM = $NICE_MVVM("AUTH_MVVM");
	AUTH_MVVM.$scope.user = {
			email:'',
			password:''
	};
	AUTH_MVVM.$scope.step = 1;
	AUTH_MVVM.$scope.show = true;
	AUTH_MVVM.$init();

	function registerAndLogin(){
		do{
			var user = AUTH_MVVM.$scope.user;
			if(AUTH_MVVM.$scope.step == 1 || AUTH_MVVM.$scope.step == 3){
				if(/^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/.test(user.email) == false){
					alert("请输入正确格式的邮箱地址");
					break;
				}

				AUTH_MVVM.$scope.step++;//进入下一步
				break;
			}
			if(AUTH_MVVM.$scope.step == 2){
				if(/^.{6,32}$/.test(user.password) == false){
					alert("请输入不少于6位的密码");
					break;
				}

				$.post("/user/register",{
					email:user.email,
					password:user.password
				},{},function(){
					alert("激活邮件已经发送至您邮箱，请前往邮箱完成激活");
					AUTH_MVVM.$scope.step=3;
					location.href="#auth";
				},function(XMLHttpRequest){
					alert(XMLHttpRequest.responseText);
				});

			}
			if(AUTH_MVVM.$scope.step == 4){
				if(/^.{6,}$/.test(user.password) == false){
					alert("请输入密码");
					break;
				}

				$.post("/user/login",{
					email:user.email,
					password:md5(user.password)
				},{},function(token){
					$.cookie("TUNNEL-TOKEN", token, {expires: 365, path: "/"});//保存token信息，1年
					//登录成功，重新加载
					location.reload();
				},function(XMLHttpRequest){
					alert(XMLHttpRequest.responseText);
				});

			}
		}while(false);
	}
	
	function logout(){
		$.cookie("TUNNEL-TOKEN", "", {expires: 1, path: "/"});//保存token信息
		location.reload();
	}
	
	function forgetPassword(){
		var user = AUTH_MVVM.$scope.user;
		do{
			if(/^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/.test(user.email) == false){
				alert("请输入正确格式的邮箱地址");
				break;
			}
			
			$.post("/user/forget_password",{
				email:user.email
			},{},function(token){
				alert("验证邮件已经发送至您邮箱，请前往邮箱完成验证");
			},function(XMLHttpRequest){
				alert(XMLHttpRequest.responseText);
			});
		}while(false);
	}
	
	
	//########## 域名 ####################
	var DOMAIN_MVVM = $NICE_MVVM("DOMAIN_MVVM");
	DOMAIN_MVVM.$scope.show = false;
	DOMAIN_MVVM.$scope.domainList = [];
	DOMAIN_MVVM.$scope.domainName = '';
	DOMAIN_MVVM.$scope.userExpire = false;//默认没过期
	DOMAIN_MVVM.$init();
	
	function showDomain(){
		PRICE_MVVM.$scope.show = false;
		DOMAIN_MVVM.$scope.show = true;
		location.href="#domain";
	}

	function postDomain(){
		var domainName = DOMAIN_MVVM.$scope.domainName;
		if(!domainName){
			alert("请输入合法的域名");
			return false;
		}
		if(/^[a-zA-Z0-9][a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][a-zA-Z0-9]{0,62})*$/.test() == false){
			alert("请输入合法的域名");
			return false;
		}
		$.post("/domain/post",{
			domainName:domainName
		},{
			"TUNNEL-TOKEN":$.cookie('TUNNEL-TOKEN')
		},function(token){
			//成功
			getMyDomainList();//刷新域名列表
		},function(XMLHttpRequest){
			alert(XMLHttpRequest.responseText);
		});
	}
	
	function delDomain(domainName){
		var result = confirm("真的删除域名配置吗？"+domainName+".tunnel.cool");
		if(result){
			$.del("/domain/del",{
				domainName:domainName
			},{
				"TUNNEL-TOKEN":$.cookie('TUNNEL-TOKEN')
			},function(token){
				//成功
				getMyDomainList();//刷新域名列表
			},function(XMLHttpRequest){
				alert(XMLHttpRequest.responseText);
			});
		}
	}
	
	//########## 续费 ####################
	var PRICE_MVVM = $NICE_MVVM("PRICE_MVVM");
	PRICE_MVVM.$scope.title = "会员续费";
	PRICE_MVVM.$scope.show = false;
	PRICE_MVVM.$scope.userExpire = false;//默认没过期
	PRICE_MVVM.$scope.payCodeUrl = "";
	PRICE_MVVM.$scope.payLimit = "";
	PRICE_MVVM.$init();
	
	function showPrice(){
		//if(HEADER_MVVM.$scope.user.status=='0'){
			//欠费用户
			PRICE_MVVM.$scope.show = true;
			DOMAIN_MVVM.$scope.show = false;
			location.href="#price";
		//}
	}
	
	function createPay(goods){
		PRICE_MVVM.$scope.title = goods;
		$.post("/pay/create_wx_order",{
			'goods':goods
		},{
			"TUNNEL-TOKEN":$.cookie('TUNNEL-TOKEN')
		},function(payCodeUrl){
			PRICE_MVVM.$scope.payCodeUrl = payCodeUrl;
			PRICE_MVVM.$onflush(checkLastPay,1000,false,"checkpay");
			
		},function(XMLHttpRequest){
			alert(XMLHttpRequest.responseText);
		});
	}
	
	function checkLastPay(){
		$.get("/pay/check_last",{},{
			"TUNNEL-TOKEN":$.cookie('TUNNEL-TOKEN')
		},function(result){
			if(result == '支付成功'){
				alert(result);
				location.reload();
			}else{
				PRICE_MVVM.$scope.payLimit = result;
				if(result != '已过期'){
					PRICE_MVVM.$onflush(checkLastPay,1000,false,"checkpay");
				}
			}
		});
	}
	
	//##########初始化获取数据#############
	function getMyUserInfo(){
		$.get("/user/info",{},{
			"TUNNEL-TOKEN":$.cookie('TUNNEL-TOKEN')
		},function(result){
			//用户信息
			HEADER_MVVM.$scope.user=result;
			//登录注册模块隐藏
			AUTH_MVVM.$scope.show = false;

			//是否过期
			DOMAIN_MVVM.$scope.userExpire = result.status=='1'?false:true;
			PRICE_MVVM.$scope.userExpire = DOMAIN_MVVM.$scope.userExpire;
		});
	}
	getMyUserInfo();
	
	//查询自己的域名列表
	function getMyDomainList(){
		$.get("/domain/list",{},{
			"TUNNEL-TOKEN":$.cookie('TUNNEL-TOKEN')
		},function(result){
			DOMAIN_MVVM.$scope.domainList=result;
			DOMAIN_MVVM.$scope.show = true;
		});
	}
	getMyDomainList();
</script>
</html>